// comm/views/hdModalView/hdModalView.js
import S_request from '../../utils/requestService.js';
import CONFIG from '../../config.js';
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    modalObj: {
      type: Object,
      value: null
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    modalObj: {},
    mobile:''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    returnEevet: function(e) {},

    leftBtnAc: function(e) {
      this.triggerEvent('modalLeftAc', e)
    },
    rightBtnAc: function(e) {
      let id = e.currentTarget.dataset.id;
      console.log("奖品id==" + id);
      if (this.data.mobile == '') {
        wx.showToast({
          title: '请填写手机号',
          icon: 'none',
          duration: 2000
        })
      } else if (this.data.mobile.length < 11) {
        wx.showToast({
          title: '手机号格式不正确',
          icon: 'none',
          duration: 2000
        })
      } else {
        S_request.mine.submitShopInfo(id, this.data.mobile, "", "", (result) => {
          this.triggerEvent('modalRightAc', result)
        })
      }
    },
    mobileInputEvent: function(e) {
      // console.log("hfhvadhvfahInput=====" + e.detail.value)
      this.setData({
        mobile: e.detail.value
      })
    }
  }
})